package com.kzj.laimeimei.recyclerCard.cardView;

import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

import com.ab.util.AbViewUtil;
import com.kzj.laimeimei.R;
import com.kzj.laimeimei.recyclerCard.basic.CardItemView;
import com.kzj.laimeimei.recyclerCard.card.other.AlphaCard;


public class AlphaCarditem extends CardItemView<AlphaCard> {

    private Context mContext;

    public AlphaCarditem(Context context, AttributeSet attrs,
                         int defStyle) {
        super(context, attrs, defStyle);
        mContext = context;
    }

    public AlphaCarditem(Context context, AttributeSet attrs) {
        super(context, attrs);
        mContext = context;
    }

    public AlphaCarditem(Context context) {
        super(context);
        mContext = context;
    }

    @SuppressLint("NewApi")
    @Override
    public void build(AlphaCard card) {
        super.build(card);
        View bottom_line = findViewById(R.id.bottom_line);
        View top_line = findViewById(R.id.top_line);
        View view = findViewById(R.id.view_alpha);
        view.getLayoutParams().height = card.getItemHeight();
        view.setTag(AbViewUtil.NotScale);
        if (card.isNeedBottomLine()) {
            bottom_line.setVisibility(VISIBLE);
        }
        if (card.isNeedTopLine()) {
            top_line.setVisibility(VISIBLE);
        }
        /*
        if (card.isAlpha()) {
			View item1=((View)textView_username.getParent());item1.setAlpha(0);
			View item2=((View)(item1.getParent()));item2.setAlpha(0);
			//item2Ϊcardview
			item2.getLayoutParams().height=card.getAlphaItemHeight();
		}else
		{
			View item1=((View)textView_username.getParent());item1.setAlpha(255);
			View item2=((View)(item1.getParent()));item2.setAlpha(255);
		}
		*/
    }
}
